﻿	
create proc sp_suavattu
@MaVT int,
@TenVT nvarchar(200),
@DVT char,
@MaNhomVT int,
@MaDV int
as
declare @dem as int
select @dem=count(*) from DanhMuc_VatTu where MaVT=@MaVT
if(@dem>0)
	begin
	update DanhMuc_VatTu
	set TenVT=@TenVT,DVT=@DVT,MaNhomVT=@MaNhomVT,MaDV=@MaDV
	where MaVT=@MaVT
	select ErrCode=1
	end
else
	begin
	select ErrCode=0
	end